<?
	include("includes/config.php");
	include("includes/login.php");
	include("includes/functions.php");
	if(@$_GET['sterge']){
			$id_comanda = $_GET['id_comanda'];
			mysql_query("delete from comenzi where id_comanda = '$id_comanda' ");
	}

?>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<body>
		<div id="header"><h1> <? echo detaliFirma('nume_firma'); ?></h1></div>
		<div id="warper">
			<?
				$resMeniu = mysql_query("select * from meniu");
			?>
			<div id="menu">
				<ul>
					<? while($rowMen = mysql_fetch_array($resMeniu)): ?>
					<li><a href="<?echo $rowMen['link'];?>"><? echo $rowMen['numeLink']; ?></a></li>
					<? endwhile; ?>
				</ul>
			</div>
			<div id="content">
				<div id="contentWrap">
					<h2>Comenzi Deschise </h2>
					<table>
						<tr id="capTabel">
							<td style="width:90px;">Numar Deviz</td>
							<td style="width:200px;">Data</td>
							<td  style="width:80px;">Nr.Inmatriculare</td>
							<td>Client</td>
							<td style="width:150px;">Editeaza Comanda</td>
						</tr>
						<? 
							$resDesch = mysql_query("select * from comenzi where status_comanda = 'deschisa' " );
							while($rowcmd = mysql_fetch_array($resDesch)):
						?>
						<tr style="height:30px;">
							<td style="text-align:center;"><? echo detaliFirma('serie_comanda') . $rowcmd['numar_comanda']; ?></td>
							<td ><? echo $rowcmd['data_comanda']; ?></td>
							<td ><? echo $rowcmd['numar_inmatriculare']; ?></td>
							<td><? echo $rowcmd['nume_persoana']; ?></td>
							<td style="text-align:center;">
								<a class="buton" href="/comenzi_deschise.php?sterge=true&id_comanda=<? echo $rowcmd['id_comanda']; ?>">Sterge</a>&nbsp;
								<a class="buton" href="/comandanoua.php?nr_comanda=<?echo $rowcmd['numar_comanda']; ?>&id_client=<?echo$rowcmd['id_client'];?>&id_masina=<?echo$rowcmd['id_masina'];?>">Edit</a>
							</td>
						</tr>
						<? endwhile;?>
						
						
						
						
					</table>
				</div>
			</div>
		</div>
	</body>
</html>